Skip to content

Make vpc.max.networks dynamic and return a useful error at the limit - #14373

Open
MitchDrage wants to merge 1 commit into
apache:mainfrom
MitchDrage:vpc-tier-limits
Open

MitchDrage wants to merge 1 commit into
apache:mainfrom
MitchDrage:vpc-tier-limits

Conversation

@MitchDrage

@MitchDrage MitchDrage commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Description

  • Changed vpc.max.networks to be dynamic, so changes no longer need a restart.
  • Hitting the limit now returns a 431 with a readable message, where it used to return a 530 "Internal error executing command".
  • The key name is unchanged, so existing values carry over without a DB migration.

Messages:
Original (HTTP 530):

  • Non-admin users: Internal error executing command, please contact your system administrator
  • Root admins: Number of networks per VPC cannot surpass [3].

New (HTTP 431, all users):
VPC web-prod has reached the maximum of 3 networks. Delete an unused network or contact your platform administrator to raise the limit.

Closes #14372

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Screenshots (if appropriate):

N/A

How Has This Been Tested?

  • Unit tests: a new test checks the limit is read from the current setting value.
  • Simulator: advanced zone, with tenant calls made as non-admin users:
    • The global limit rejects the extra tier with a 431 and the message above.
    • Changing the global value applies straight away.

How did you try to break this feature and the system with this change?

  • Tested an upgrade from an existing install: a custom value of 4 was kept.
  • Tried to change the setting as a domain admin. It's refused.
  • Ran the full server module test suite. All tests pass.

Comment thread engine/components-api/src/main/java/com/cloud/network/vpc/VpcManager.java Outdated
@MitchDrage MitchDrage changed the title Allow per-Domain/Account VPC tier limits Make vpc.max.networks dynamic and return a useful error at the limit Oct 10, 2026
@MitchDrage

Copy link
Copy Markdown
Contributor Author

I've changed direction on this PR. Per-account/domain values aren't needed: the cap exists to handle the technical limitation of the VR's NIC capacity which is the same for every tenant, and VPC tiers already count toward the account and domain guest network limits.
I've removed the per-account/domain values, and this PR now makes the global setting dynamic, with the clearer error. I've updated the title and description to match.

@Damans227 Damans227 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @MitchDrage, keeping it global looks right. LGTM

@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 20.22%. Comparing base (f03cffc) to head (d95452e).
⚠️ Report is 41 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main   #14373   +/-   ##
=========================================
  Coverage     20.21%   20.22%           
- Complexity    20747    20754    +7     
=========================================
  Files          6426     6426           
  Lines        580181   580182    +1     
  Branches      71033    71033           
=========================================
+ Hits         117282   117326   +44     
+ Misses       450184   450145   -39     
+ Partials      12715    12711    -4     
Flag Coverage Δ
uitests 3.69% <ø> (ø)
unittests 21.51% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19646

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Make vpc.max.networks dynamic and improve the limit-reached error

4 participants